package leetcode;

/**
 * @author Liangyaoyun
 */
@SuppressWarnings("all")
public class leetCode9 {
    public boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        int p = x;
        String res = "";
        while (x >= 10) {
            res = res + "" + x % 10;
            x = x / 10;
        }
        res = res + x + "";
        if (Long.valueOf(res) == p) {
            return true;
        } else {
            return false;
        }
    }


    public static void main(String[] args) {
        leetCode9 leetCode9 = new leetCode9();
        leetCode9.isPalindrome(10);
    }
}
